package com.lmqb.page;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.lmqb.constant.Constant;
import com.lmqb.constant.Fileds;

public class PagerModel<T> implements Fileds,Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private List<T> list=new ArrayList<T>(Constant.PAGE_SIZE);
	
	private int totalRow;//总共有多少条记录
	
	private int pageSize=Constant.PAGE_SIZE;//每页显示多少条记录
	
	private int offset;//偏移量。从第几条数据开始
	
	private int totalPage;//总页数。
	
	private int page;//当前页。当前是第几页。
	
	private String key;//搜索用的关键字。
	
	private String time1;//起始时间。查找某时间范围的记录时使用
	
	private String time2;//结束时间。查找某时间范围的记录时使用
	
	private Integer time1Int;//time1转成整数
	
	private Integer time2Int;//time2转成整数
	
	private Integer step;//根据审核步骤查询
	
	private Integer repayStatus1;//根据还款状态查询
	
	private String tot="";
	
	
    public String getTot() {
		return tot;
	}

	public void setTot(String tot) {
		this.tot = tot;
	}

	public Integer getRepayStatus1() {
		return repayStatus1;
	}

	public void setRepayStatus1(Integer repayStatus) {
		this.repayStatus1 = repayStatus;
	}

	public Integer getStep() {
		return step;
	}

	public void setStep(Integer step) {
		this.step = step;
	}

	public Integer getTime1Int() {
		return time1Int;
	}

	public void setTime1Int(Integer time1Int) {
		this.time1Int = time1Int;
	}

	public Integer getTime2Int() {
		return time2Int;
	}

	public void setTime2Int(Integer time2Int) {
		this.time2Int = time2Int;
	}

	private Integer userId;//用户id。查找跟某个用户有关的记录时使用（当前登录用户）
	
	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public List<T> getList() {
		return list == null ? new ArrayList<T>(Constant.PAGE_SIZE) : list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}

	public int getTotalRow() {
		return totalRow;
	}

	public void setTotalRow(int totalRow) {
		this.totalRow = totalRow;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getOffset() {
		if (page == 0)
		{
			offset = 0;
		}
		else
		{
			offset = (page - 1) * this.pageSize;
		}
		return offset;
	}
	
	public int getOffset1() {
		if (page == 0)
		{
			offset = 0;
		}
		return offset;
	}

	public void setOffset(int offset) {
		this.offset = offset;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getTime1() {
		return time1;
	}

	public void setTime1(String time1) {
		this.time1 = time1;
	}

	public String getTime2() {
		return time2;
	}

	public void setTime2(String time2) {
		this.time2 = time2;
	}

	
	@Override
	public String toString() {
		return "PagerModel [list=" + list + ", totalRow=" + totalRow
				+ ", pageSize=" + pageSize + ", offset=" + offset
				+ ", totalPage=" + totalPage + ", page=" + page + ", key="
				+ key + ", time1=" + time1 + ", time2=" + time2 + ", time1Int="
				+ time1Int + ", time2Int=" + time2Int + ", step=" + step
				+ ", userId=" + userId + "]";
	}

	

	
}
